package com.it.chapter03;

import android.os.Bundle;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class TextSizeActivity extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_text_size);

        // 使用Java代码设置字体大小
        TextView tv = findViewById(R.id.tv_px);
        // Java提供的单位默认是sp
        tv.setTextSize(30);
    }
}